#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/17113/learning/");

    vector<int> days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int ans = 0, week = 0;

    for(int i = 1; i <= 12; i++) {
        for(int j = 1; j <= days[i]; j++) {
            if(week == 1) ans += 5;
            else if(i == 1 || i > 9) ans += 5;
            else if(j / 10 == 1 || j % 10 == 1) ans += 5;
            else ans += 1;

            week = (week + 1) % 7;
        }
    }
    cout << ans;

    return 0;
}

